package ae.pcfc.etks.online.common.domain;


import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ProcessStep entity. @author Mohtisham.Salahria
 */
@Entity
@Table(name = "T_ETKS_PROCESS_STEP", schema = "ETKS_ONLINE_DBA")
public class ProcessStep implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String processStepCode;
	//private ProcessStepId id;
	private Process Process;
	private String processStepDesc;
	private String processStepDescA;
	private String processStepStatus;
	private Set<ProcStepsComnts> ProcStepsComntses = new HashSet<ProcStepsComnts>(
			0);
	private Set<ProcStepAthmnt> ProcStepAthmnts = new HashSet<ProcStepAthmnt>(
			0);
	private Set<ProcStepActions> ProcStepActionses = new HashSet<ProcStepActions>(
			0);

	public ProcessStep() {
	}

	public ProcessStep(ProcessStepId id, Process Process,
			String processStepStatus) {
		//this.id = id;
		this.Process = Process;
		this.processStepStatus = processStepStatus;
	}

	public ProcessStep(ProcessStepId id, Process Process,
			String processStepDesc, String processStepDescA,
			String processStepStatus,
			Set<ProcStepsComnts> ProcStepsComntses,
			Set<ProcStepAthmnt> ProcStepAthmnts,
			Set<ProcStepActions> ProcStepActionses) {
		//this.id = id;
		this.Process = Process;
		this.processStepDesc = processStepDesc;
		this.processStepDescA = processStepDescA;
		this.processStepStatus = processStepStatus;
		this.ProcStepsComntses = ProcStepsComntses;
		this.ProcStepAthmnts = ProcStepAthmnts;
		this.ProcStepActionses = ProcStepActionses;
	}
	
	public ProcessStep(String processStepCode, String processCode,
			String processStepStatus, Set<ProcStepsComnts> ProcStepsComntses) {
		//this.id = new ProcessStepId(processStepCode, processCode);		
		this.processStepStatus = processStepStatus;		
		this.ProcStepsComntses = ProcStepsComntses;
	}
	
	public ProcessStep(String processStepCode, String processCode,
			String processStepStatus) {
		//this.id = new ProcessStepId(processStepCode, processCode);		
		this.processStepStatus = processStepStatus;	
		
	}
	
	@Id
	@Column(name = "PROCESS_STEP_CODE", length = 10)
	public String getProcessStepCode() {
		return processStepCode;
	}

	public void setProcessStepCode(String processStepCode) {
		this.processStepCode = processStepCode;
	}

	/*@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "processStepCode", column = @Column(name = "PROCESS_STEP_CODE", nullable = false, length = 10)),
			@AttributeOverride(name = "processCode", column = @Column(name = "PROCESS_CODE", nullable = false, length = 10)) })
	public ProcessStepId getId() {
		return this.id;
	}

	public void setId(ProcessStepId id) {
		this.id = id;
	}*/

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PROCESS_CODE", nullable = false, insertable = false, updatable = false)
	public Process getProcess() {
		return this.Process;
	}

	public void setProcess(Process Process) {
		this.Process = Process;
	}

	@Column(name = "PROCESS_STEP_DESC", length = 80)
	public String getProcessStepDesc() {
		return this.processStepDesc;
	}

	public void setProcessStepDesc(String processStepDesc) {
		this.processStepDesc = processStepDesc;
	}

	@Column(name = "PROCESS_STEP_DESC_A", length = 80)
	public String getProcessStepDescA() {
		return this.processStepDescA;
	}

	public void setProcessStepDescA(String processStepDescA) {
		this.processStepDescA = processStepDescA;
	}

	@Column(name = "PROCESS_STEP_STATUS", nullable = false, length = 4)
	public String getProcessStepStatus() {
		return this.processStepStatus;
	}

	public void setProcessStepStatus(String processStepStatus) {
		this.processStepStatus = processStepStatus;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "processStep")
	public Set<ProcStepsComnts> getProcStepsComntses() {
		return this.ProcStepsComntses;
	}

	public void setProcStepsComntses(
			Set<ProcStepsComnts> ProcStepsComntses) {
		this.ProcStepsComntses = ProcStepsComntses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "processStep")
	public Set<ProcStepAthmnt> getProcStepAthmnts() {
		return this.ProcStepAthmnts;
	}

	public void setProcStepAthmnts(
			Set<ProcStepAthmnt> ProcStepAthmnts) {
		this.ProcStepAthmnts = ProcStepAthmnts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "processStep")
	public Set<ProcStepActions> getProcStepActionses() {
		return this.ProcStepActionses;
	}

	public void setProcStepActionses(
			Set<ProcStepActions> ProcStepActionses) {
		this.ProcStepActionses = ProcStepActionses;
	}

}
